//热搜
hotSearchSortType();
$(function(){
		$(".goods").click(function(){
			$(this).addClass('curr').siblings().removeClass('curr');
			$('#goods').css("display", "block");
			$('#shop').css("display", "none");
		})
		$(".shop").click(function(){
			$(this).addClass('curr').siblings().removeClass('curr');
			$("#shop").css("display", "block");
			$('#goods').css("display", "none");
		})
	})

//全局商品查询
function getMyGoods() {
	var goodsName = $("#goodsName").val().trim();
	location.href = '6.0.0zhaohuo.html?goodsTitle=' + goodsName;
}
//全局店铺查询
function getMyShops() {
	var shopName = $("#shopName").val().trim();
	location.href = '10.0.0dianpu.html?shopName=' + shopName;
}
 

//分类
function hotSearchSortType() {
	$("#hotSearchSortTypeList").html("");
	$.ajax({
		url: urlcore + "/api/hotSearch/selectHotSearchList",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success: function(data) {

			if(data.success == true) {
				$.each(data.data, function(i, n) {
					var thislist = '<a href="6.0.0zhaohuo.html?goodsTitle='+n.goodsTitle+'">' + '<span class="tags">' + n.goodsTitle + '</span>' + '</a>';
					$('#hotSearchSortTypeList').append(thislist);
				});
				/*$(function() {
					//选中
					$('.logo_seach_fnav a').on('click', function() {
						$(this).find('span').removeClass('on');
						$(this).find('span').addClass('on');
					});
				})*/
			}
		},
		error: function() {
			layer.alert("error");
		}
	});
}

//按分类查询
/*function searchBySortType1(sortTypeId) {
location.href='6.0.0zhaohuo.html?sortTypeId='+sortTypeId;	
}
*/